package dk.pun.aot.client.event;

import com.google.gwt.event.shared.GwtEvent;

import dk.pun.aot.shared.character.QualityType;

public class CoreQualityUpdatedEvent extends GwtEvent<CoreQualityUpdatedEventHandler> {

	public static Type<CoreQualityUpdatedEventHandler> TYPE = new Type<CoreQualityUpdatedEventHandler>();

	private final QualityType type;
	private final int score;

	public CoreQualityUpdatedEvent(QualityType type, int score) {
		this.type = type;
		this.score = score;
	}

	public QualityType getCoreQualityType() {
		return this.type;
	}
	
	public int getCoreQualityScore() {
		return this.score;
	}

	@Override
	public Type<CoreQualityUpdatedEventHandler> getAssociatedType() {
		return TYPE;
	}

	@Override
	protected void dispatch(CoreQualityUpdatedEventHandler handler) {
		handler.onCoreQualityUpdated(this);
	}

}
